ff081f6d0c2d71ddb7d68b2d405a4049c4104cb8,xwiki-platform-core/xwiki-platform-oldcore/src/test/java/com/xpn/xwiki/render/DefaultVelocityManagerTest.java,DefaultVelocityManagerTest,getVelocityEngineWhenNoVelocityEngineInCache,#,92
Before Change
VelocityEngine velocityEngine = mock(VelocityEngine.class);
when(velocityFactory.createVelocityEngine(eq("default"), any(Properties.class))).thenReturn(velocityEngine);
TemplateManager templates = mock(TemplateManager.class);
Provider<TemplateManager> templatesProvider = this.mocker.getInstance(new DefaultParameterizedType(null, Provider.class,
TemplateManager.class));
when(templatesProvider.get()).thenReturn(templates);
Assert.assertSame(velocityEngine, this.mocker.getComponentUnderTest().getVelocityEngine());
}
After Change
VelocityEngine velocityEngine = mock(VelocityEngine.class);
when(velocityFactory.createVelocityEngine(eq("default"), any(Properties.class))).thenReturn(velocityEngine);
this.mocker.registerMockComponent(TemplateManager.class);
Assert.assertSame(velocityEngine, this.mocker.getComponentUnderTest().getVelocityEngine());
}